﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Quartz调度管理</title>
    <link rel="stylesheet" href="/assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="/assets/css/login.css?v=315">
    <link rel="stylesheet" href="/assets/module/admin.css?v=315">
    <script type="text/javascript" src="/assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="/assets/js/common.js?v=315"></script>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script>
        if (window != top) {
            top.location.replace(location.href);
        }
    </script>
</head>
<body>
    <div class="login-wrapper">
        <div class="login-header">
        </div>
        <div class="login-body">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="layui-icon layui-icon-engine"></i>&nbsp;&nbsp;用户登录
                </div>
                <form class="layui-card-body layui-form layui-form-pane">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
                        <div class="layui-input-block">
                            <input name="userName" type="text" placeholder="账号" class="layui-input"
                                   lay-verType="tips" style="height:38px;" lay-verify="required" required />
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
                        <div class="layui-input-block">
                            <input name="pwd" type="password" placeholder="密码" class="layui-input"
                                   lay-verType="tips" style="height:38px;" lay-verify="required" required />
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button lay-filter="login-submit" class="layui-btn layui-btn-fluid" lay-submit>登 录</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="login-footer">
            <p>© 2021 杜子腾 版权所有</p>
        </div>
    </div>

    <script>
        layui.use(['layer', 'form'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var form = layui.form;

            // 表单提交
            form.on('submit(login-submit)', function (obj) {
                $.ajax({
                    url: '/api/System/login',
                    method: 'Post',
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify(obj.field),
                    dataType: "JSON",
                    success: function (res) {
                        if (res.success) {
                            layer.msg(res.message, { icon: 1 }, function ()
                            {
                                window.location.href = '/'
                            });
                        } else {
                            layer.closeAll('loading');
                            layer.msg(res.message, { icon: 5 });
                        }
                    }
                });
                return false;
            });
        });
    </script>
</body>
</html>
